<script>
	export default {
		onLaunch: function() {
			console.log('My App Launch')
			console.log('start Load font yshst')
			this.calcNavBarInfo();
			
			this.$store.dispatch("getImages");
			this.$store.dispatch("getBannerImages");
			this.$store.dispatch("getFont");
			this.$store.dispatch("getWeixinToken");
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			calcNavBarInfo() {
				const systemInfo = uni.getSystemInfoSync();
				const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
				console.log('systemInfo', systemInfo.screenWidth)
				
				const navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
				this.$store.commit('changeNavBarHeight', navBarHeight);
				this.$store.commit('changeStatusBarHeight', systemInfo.statusBarHeight)
				this.$store.commit('changeScreenWidth', systemInfo.screenWidth)
			},
		}
	}
</script>

<style>
	/*每个页面公共css */
	.content {
		background-color: #e5f2f9;
		//padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
</style>
